package com.lczyfz.istep.common.utils.domain;

/**
 * Created by chenqk on 2017/4/26.
 */
public class UpstreamServer {

    /**
     * 主机地址，如 127.0.0.1
     */
    private String host;
    /**
     * 端口，如 8080
     */
    private Integer port;
    /**
     * 权重，权值越高被分配到的几率越大；单主机默认为 1
     */
    private Integer weight = 1;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public String getHostWithPort() {
        return host + ":" +port;
    }

    public String getPlainConfig() {
        return getHostWithPort() + " weight=" + weight + ";";
    }
}
